<?
require("config.php");

$label = "Product List";

$table="pro_basic";


if ($cat){
	$Query="SELECT 
	id,
	name,
	code,
	stock,
	reorder,
	brand
	FROM $table WHERE 
	category	= '$cat' 
	ORDER BY id DESC";


}
else {
	$Query="SELECT 
	id,
	name,
	code,
	stock,
	reorder,
	brand
	FROM $table 
	ORDER BY id DESC";

}
	$r=myQuery($Query);
?>

<html>
<head>
<title>Product List</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link href="<?echo $rela_path?>inc/css.css" rel="stylesheet" type="text/css">
</head>
<body class="cbody">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tb">
  <tr class="tbheader"> 
    <td width="4%"> <div align="center">No.</div></td>
    <td width="48%"> <div align="center">Product Name</div></td>
    <td width="24%"> <div align="center">Product Code</div></td>
    <td width="12%"> <div align="center">Current Stock</div></td>
    <td width="12%"> <div align="center">Current Reorder</div></td>
  </tr>

<?if ($r){
	for ($i=0;$i<count($r);$i++){?>
  <tr class="tbcontent1"> 
    <td width="4%" align="center"><?print($i+1)?></td>
    <td><a href="#" onClick="window.open('../inc/trans.php?search=<?print($r[$i][0])?>&method=product','','width=400 height=400')"><?=$r[$i][1].'<br>'.$r[$i][5]?></a></td>
    <td><?print($r[$i][2])?></td>
    <td> <div align="center"><?print($r[$i][3])?></div></td>
    <td> <div align="center"><?print($r[$i][4])?></div></td>
  </tr>
<?}
}?>


</table>
</body></html>